package cc.yaomm.service.supply;

import cc.yaomm.common.basic.base.SuperApplication;
import cc.yaomm.common.basic.util.TokenUtils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.beans.factory.config.EmbeddedValueResolver;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.data.redis.core.StringRedisTemplate;

/**
 * Created by XQL on 2021/6/15.
 */
@SpringBootApplication
public class SupplyServiceApp extends SuperApplication {

    public static void main(String[] args) {
        SpringApplication.run(SupplyServiceApp.class, args);
    }

    @Bean
    public TokenUtils getTokenUtils(@Autowired StringRedisTemplate redisTemplate) {
        return new TokenUtils(2 * 60 * 60, redisTemplate);
    }

    /**
     * <p>@Description : EL表达式解析器 </p>
     * <p>@Author : QiLin.Xing </p>
     * <p>@Date : 2021/6/21 13:36 </p>
     */
    @Bean
    public EmbeddedValueResolver getEmbeddedValueResolver(@Autowired ConfigurableBeanFactory configurableBeanFactory) {
        return new EmbeddedValueResolver(configurableBeanFactory);
    }

}
